<template>
	<view>
		<view class="feedback-list" v-for="(item,index) in list" :key="item.feedback_id">
			<view class="feedback-left">
				<text>{{ item.feedback_type == 99 ? '其他' : feedbackType[item.feedback_type] }}</text>
				<text>{{ item.create_time }}</text>
			</view>
			<view class="feedback-right">
				<text :style="item.status == 1 ? 'color: #37CE0E;' : ''">{{ item.status == 1 ? '已处理' : '处理中'}}</text>
				<text v-if="item.status == 1">{{ resultType[item.result_type] }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userId: null,
				list: [],
				feedbackType: ['请选择反馈问题', '设备不启动', '其他'],
				resultType: ['', '已退款', '已退币', '无订单记录', '金额与订单记录不符', '用户已投币 问题不存在', '其他']
			};
		},
		onLoad() {
			this.getFeedbackRecord()
		},
		methods: {
			async getFeedbackRecord() {
				let params = {
					userId: '1',
					pageNumber: 1,
					pageSize: 9999
				}
				let result = this.$request.feedback(params).then(res => {
					if (res.data.ret_code * 1 == 0) {
						this.list = res.data.ret_module.resultList
					} else {
						uni.showModal({
							title: '提示',
							content: res.data.ret_msg,
							showCancel: false,
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f3f4f5;
	}

	.feedback-list {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 2rpx;
		height: 140rpx;
		background-color: #ffffff;
		box-sizing: border-box;
		padding: 24rpx;
	}

	.feedback-left,
	.feedback-right {
		display: flex;
		flex-direction: column;
	}

	.feedback-right {
		text-align: right;
	}

	.feedback-left text:nth-child(1) {
		font-size: 16px;
		color: #323C47;
	}

	.feedback-left text:nth-child(2) {
		font-size: 14px;
		color: #8F9DAE;
	}

	.feedback-right text:nth-child(1) {
		font-size: 16px;
		color: #4DA1FF;
	}

	.feedback-right text:nth-child(2) {
		font-size: 14px;
		color: #323C47;
	}
</style>